Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Language Guide / Part 2 - AppleScript Language Reference
Chapter 4 - Commands / Command Definitions


Close application command

A Close command is a request to close one or more objects.

SYNTAX
close referenceToObject [ saving in referenceToFile ] [ saving saveOption ] 
PARAMETERS
referenceToObject
A reference to the object or objects to close.
Class: Reference
referenceToFile
A reference of the form file nameString or alias nameString (see "Notes").
Class: Reference
Default value: The file in which the object was last saved. If the object hasn't been saved before, the application creates a file with the specified name in the current directory.
saveOption
A parameter that specifies whether to save an object that has been modified before closing it. The constant yes specifies that the object must be saved. The constant no specifies that the object must not be saved. The constant ask specifies that the user must be asked whether or not to save the object.
Class: Constant
Default value: The default value is ask, unless you specify a
file in which to save the object, in which case the default value
is yes.
RESULT
None

EXAMPLES
tell application "Scriptable Text Editor"   close window "Tremendous" saving Yes
end tell
tell application "Scriptable Text Editor"   close saving in file "Macintosh HD:Documents:Report"end tell
NOTES
To specify the name (nameString) of a file in which to save the object, use a string of the form "Disk:Folder1:Folder2:...:Filename"; for details, see "References to Files," which begins on page 144. You can also specify a string with only a filename ("Filename"). In this case, the application attempts to find the file in the current directory. If it can't find the specified file, the application creates a file with the specified name in the current directory.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996